// Decompiled by GOOSIN CO,LTD Copyright 2010 Pavel Kouznetsov.
// home page: http://www.Goosin.net
// Decompiler options: packimports(3) fieldsfirst ansi space 
// Source File Name:   backup_ok.java

package security.backup;

import include.data_backup.MysqlStore;
import include.nseer_cookie.down;
import java.io.IOException;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.http.*;
import javax.servlet.jsp.JspFactory;

public class backup_ok extends HttpServlet
{

	public backup_ok()
	{
	}

	public void service(HttpServletRequest request, HttpServletResponse response)
		throws IOException, ServletException
	{
		HttpSession dbSession = request.getSession();
		JspFactory _jspxFactory = JspFactory.getDefaultFactory();
		javax.servlet.jsp.PageContext pageContext = _jspxFactory.getPageContext(this, request, response, "", true, 8192, true);
		ServletContext dbApplication = dbSession.getServletContext();
		HttpSession session = request.getSession();
		down down = new down();
		MysqlStore mysql = new MysqlStore();
		try
		{
			ServletContext context = session.getServletContext();
			String path = context.getRealPath("/");
			if (mysql.backup((new StringBuilder(String.valueOf((String)session.getAttribute("unit_db_name")))).append("_backup.sql").toString(), (String)session.getAttribute("unit_db_name")))
				down.download(response, (new StringBuilder(String.valueOf(path))).append("WEB-INF/").append((String)session.getAttribute("unit_db_name")).append("_backup.sql").toString());
		}
		catch (Exception ex)
		{
			ex.printStackTrace();
		}
	}
}
